/*
	File:	video/State.hpp
	Date:	2013-06-09
	Author:	Asteroth
*/

#include "../gl.hpp"

#ifndef __ZEN_STATE_HPP__
#define __ZEN_STATE_HPP__

namespace zen {
	
	namespace video {


		/*class Settings {
		private:
			static int _minAliasedPointSize, _maxAliasedPointSize;
			static int _minAliasedLineWidth, _maxAliasedLineWidth;
			static int _minAntialiasedPointSize, _maxAntialiasedPointSize;
			static int _minAntialiasedLineWidth, _maxAntialiasedLineWidth;
			static int _redBits, _greenBits, _blueBits, _alphaBits, _depthBits, _stencilBits;
			static int _maxElementIndices, _maxElementVertices;
			static int _maxLights;
			static int _maxTextureSize;
			static int _maxViewportWidth, _maxViewportHeight;
			static int _maxTextureUnits;

			static bool initialized;
			static bool initialize();

		public:
			/// Returns the smallest supported size for aliased points.
			static inline int minAliasedPointSize()         {return _minAliasedPointSize;}

			/// Returns the largest supported size for aliased points.
			static inline int maxAliasedPointSize()         {return _maxAliasedPointSize;}

			/// Returns the smallest supported width for aliased lines.
			static inline int minAliasedLineWidth()         {return _minAliasedLineWidth;}

			/// Returns the largest supported width for aliased lines.
			static inline int maxAliasedLineWidth()         {return _maxAliasedLineWidth;}

			/// Returns the smallest supported width for antialiased points.
			static inline int minAntialiasedPointSize()     {return _minAntialiasedPointSize;}

			/// Returns the largest supported width for antialiased points.
			static inline int maxAntialiasedPointSize()     {return _maxAntialiasedPointSize;}

			/// Returns the smallest supported width for antialiased lines.
			static inline int minAntialiasedLineWidth()     {return _minAntialiasedLineWidth;}

			/// Returns the largest supported width for antialiased lines.
			static inline int maxAntialiasedLineWidth()     {return _maxAntialiasedLineWidth;}

			/// Returns the number of red bitplanes in the color buffer.
			static inline int redBits()                     {return _redBits;}

			/// Returns the number of green bitplanes in the color buffer.
			static inline int greenBits()                   {return _greenBits;}

			/// Returns the number of blue bitplanes in the color buffer.
			static inline int blueBits()                    {return _blueBits;}

			/// Returns the number of alpha bitplanes in the color buffer.
			static inline int alphaBits()                   {return _alphaBits;}

			/// Returns the number of bitplanes in the depth buffer.
			static inline int depthBits()                   {return _depthBits;}

			/// Returns the number of bitplanes in the stencil buffer.
			static inline int stencilBits()                 {return _stencilBits;}

			/// Returns the recommended maximum number of vertex array indices.
			static inline int maxElementIndices()           {return _maxElementIndices;}

			/// Returns the maximum number of lights.
			static inline int maxLights()                   {return _maxLights;}

			/// Returns the recommended maximum number of vertex array vertices.
			static inline int maxElementVertices()          {return _maxElementVertices;}

			/// Returns the largest texture size that the video card can handle.
			static inline int maxTextureSize()              {return _maxTextureSize;}

			/// Returns the maximum number of textures that can be used in multitexturing.
			static inline int maxTextureUnits()             {return _maxTextureUnits;}

			/// Returns the maximum supported width of the viewport.
			static inline int maxViewportWidth()            {return _maxViewportWidth;}

			/// Returns the maximum supported height of the viewport.
			static inline int maxViewportHeight()           {return _maxViewportHeight;}
		};

		/// === Implementation ============================================================================

		int Settings::_minAliasedPointSize;
		int Settings::_maxAliasedPointSize;
		int Settings::_minAliasedLineWidth;
		int Settings::_maxAliasedLineWidth;
		int Settings::_minAntialiasedPointSize;
		int Settings::_maxAntialiasedPointSize;
		int Settings::_minAntialiasedLineWidth;
		int Settings::_maxAntialiasedLineWidth;
		int Settings::_redBits;
		int Settings::_greenBits;
		int Settings::_blueBits;
		int Settings::_alphaBits;
		int Settings::_depthBits;
		int Settings::_stencilBits;
		int Settings::_maxElementIndices;
		int Settings::_maxElementVertices;
		int Settings::_maxLights;
		int Settings::_maxTextureSize;
		int Settings::_maxViewportWidth;
		int Settings::_maxViewportHeight;
		int Settings::_maxTextureUnits;
		bool Settings::initialized = Settings::initialize();

		bool Settings::initialize() {
			GLint resi[2];
			glGetIntegerv(GL_ALIASED_POINT_SIZE_RANGE, resi);
			_minAliasedPointSize = resi[0];
			_maxAliasedPointSize = resi[1];
			glGetIntegerv(GL_ALIASED_LINE_WIDTH_RANGE, resi);
			_minAliasedLineWidth = resi[0];
			_maxAliasedLineWidth = resi[1];
			glGetIntegerv(GL_SMOOTH_POINT_SIZE_RANGE, resi);
			_minAntialiasedPointSize = resi[0];
			_maxAntialiasedPointSize = resi[1];
			glGetIntegerv(GL_SMOOTH_LINE_WIDTH_RANGE, resi);
			_minAntialiasedLineWidth = resi[0];
			_maxAntialiasedLineWidth = resi[1];
			glGetIntegerv(GL_RED_BITS, resi);
			_redBits = resi[0];
			glGetIntegerv(GL_GREEN_BITS, resi);
			_greenBits = resi[0];
			glGetIntegerv(GL_BLUE_BITS, resi);
			_blueBits = resi[0];
			glGetIntegerv(GL_ALPHA_BITS, resi);
			_alphaBits = resi[0];
			glGetIntegerv(GL_DEPTH_BITS, resi);
			_depthBits = resi[0];
			glGetIntegerv(GL_STENCIL_BITS, resi);
			_stencilBits = resi[0];
			glGetIntegerv(GL_MAX_ELEMENTS_INDICES, resi);
			_maxElementIndices = resi[0];
			glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, resi);
			_maxElementVertices = resi[0];
			glGetIntegerv(GL_MAX_LIGHTS, resi);
			_maxLights = resi[0];
			glGetIntegerv(GL_MAX_TEXTURE_SIZE, resi);
			_maxTextureSize = resi[0];
			glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, resi);
			_maxTextureUnits = resi[0];
			glGetIntegerv(GL_MAX_VIEWPORT_DIMS, resi);
			_maxViewportWidth = resi[0];
			_maxViewportHeight = resi[1];

			return true;
		}*/


	} // namespace video

} // namespace zen

#endif // __ZEN_STATE_HPP__
